function init () {
	var botones = document.getElementsByClassName('delayed');
	
	for(var i =0; i<botones.length; i++){
		botones[i].addEventListener('click', delay, false);
	}
}

function delay(e) {
	e.preventDefault();
	var boton = e.target;
	boton.previousElementSibling.style.opacity=1;
	window.setTimeout(function (){
		boton.previousElementSibling.style.opacity=0;
		boton.parentNode.submit();
	}, 2500);
}
window.addEventListener('load', init, false);